
//https://www.cnblogs.com/RitaLee/p/10375068.html let 和 var 的区别

var a = 0;
var a = 1;

//let b= 0; let b = 1;  编译会报错


// 04-18 06:06:13.424 32249-30646/com.example.harmonystudy I 0FEFE/JsApp: testVar 1
export function testVar() {
  var array: number[] = [1, 2, 3]
  for (var index = 0; index < array.length; index++) {
    const element = array[index];
    for (var index = 0; index < array.length; index++) {

    }
    console.log("testVar", element.toString())
  }
}

// 04-18 06:06:13.424 32249-30646/com.example.harmonystudy I 0FEFE/JsApp: testLet 1
// 04-18 06:06:13.424 32249-30646/com.example.harmonystudy I 0FEFE/JsApp: testLet 2
// 04-18 06:06:13.424 32249-30646/com.example.harmonystudy I 0FEFE/JsApp: testLet 3
export function testLet() {
  var array: number[] = [1, 2, 3]
  for (let index = 0; index < array.length; index++) {
    const element = array[index];
    for (let index = 0; index < array.length; index++) {

    }
    console.log("testLet", element.toString())
  }
}